package com.ctshk.rpc.bus.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.ctshk.common.service.mapper.CtsBaseMapper;
import com.ctshk.rpc.bus.dto.BusProductReservationSettingsDTO;
import com.ctshk.rpc.bus.entity.BusProductReservationSettings;

/**
 * <p>
 * 巴士产品预订设置 Mapper 接口
 * </p>
 *
 * @author 彭柳霖
 * @since 2021-02-19
 */
public interface BusProductReservationSettingsMapper extends CtsBaseMapper<BusProductReservationSettings> {

    /**
     * 根据产品id查询产品预订设置
     * @param busProductId
     * @return
     */
    @Select("<script>"+"select id,bus_product_id,sale_type,sale_begin_date,sale_end_date, \n" +
            "is_confirm,booking_information,change_settings,service_charge_type,service_charge_price, \n"+
            "refund_fee_price,refund_fee_type,is_need_certificates,ticket_collection_type,ticket_collection,exchange_method \n"+
            "from t_bus_product_reservation_settings \n"+
            "where bus_product_id = #{busProductId} \n" +
            "</script>")
    List<BusProductReservationSettingsDTO> queryList(@Param("busProductId") Long busProductId);
}
